/**
 * 应用常量定义
 */

// 文件类型常量
export const FILE_TYPES = {
  TYPESCRIPT: '.ts',
  JAVASCRIPT: '.js',
  VUE: '.vue',
  JSON: '.json',
  MARKDOWN: '.md',
  CSS: '.css',
  SCSS: '.scss',
  HTML: '.html',
  TEXT: '.txt'
} as const

// 支持的文件扩展名
export const SUPPORTED_EXTENSIONS = Object.values(FILE_TYPES)

// 历史目录相关常量
export const HISTORY_CONSTANTS = {
  HISTORY_DIR: 'History',
  ENTRIES_FILE: 'entries.json',
  VERSION_ID_PATTERN: /^-?[a-f0-9]+$/i,
  MAX_HISTORY_VERSIONS: 1000,
  MAX_FILES_PER_VERSION: 10000
} as const

// 搜索相关常量
export const SEARCH_CONSTANTS = {
  MAX_RESULTS: 100,
  DEFAULT_CONTEXT_LINES: 3,
  MIN_QUERY_LENGTH: 2,
  DEBOUNCE_DELAY: 300,
  MAX_FILE_SIZE_FOR_CONTENT_SEARCH: 10 * 1024 * 1024 // 10MB
} as const

// 恢复操作常量
export const RECOVERY_CONSTANTS = {
  MAX_CONCURRENT_OPERATIONS: 5,
  DEFAULT_TIMEOUT: 30000, // 30秒
  MAX_RETRY_ATTEMPTS: 3,
  BACKUP_SUFFIX: '.backup'
} as const

// UI相关常量
export const UI_CONSTANTS = {
  NOTIFICATION_DURATION: 5000,
  LOADING_DEBOUNCE: 200,
  VIRTUAL_SCROLL_ITEM_HEIGHT: 32,
  MAX_VISIBLE_NOTIFICATIONS: 5
} as const

// 错误代码常量
export const ERROR_CODES = {
  HISTORY_DIR_NOT_FOUND: 'E001',
  ENTRIES_FILE_CORRUPT: 'E002',
  FILE_ACCESS_DENIED: 'E003',
  INVALID_VERSION_ID: 'E004',
  RECOVERY_TARGET_EXISTS: 'E005',
  SEARCH_INDEX_CORRUPT: 'E006',
  OPERATION_TIMEOUT: 'E007'
} as const

// 应用配置常量
export const APP_CONFIG = {
  NAME: 'File History Manager',
  VERSION: '1.0.0',
  AUTHOR: 'Development Team',
  DESCRIPTION: '文件历史版本管理工具'
} as const